import enUS from 'vant/es/locale/lang/en-US'
import zhCN from 'vant/es/locale/lang/zh-CN'

import store from '@/store'

import { createI18n } from 'vue-i18n'
import messages from '@intlify/vite-plugin-vue-i18n/messages'

export const locale = [
  {
    title: '简体中文',
    value: 'zh-CN',
    vant: 'zh-CN',
    vantvalue: zhCN
  },
  {
    title: 'English',
    value: 'en-US',
    vant: 'en-US',
    vantvalue: enUS
  }
]

export const i18n = createI18n({
  locale: store.state.language,
  legacy: false,
  globalInjection: false,
  messages
})
